1. Field of the Invention
The present invention relates to a motion vector detection apparatus, a motion vector detection method, and image capturing apparatus and, more particularly, to a motion vector detection apparatus which detects a motion vector used to correct any blur in a captured motion image, a motion vector detection method, and an image capturing apparatus.
2. Description of the Related Art
In an image capturing apparatus such as a video camera, which captures a motion image, especially when a lens is zoomed to the telephoto-side, a captured image often blurs due to a camera shake, thus posing a problem. In order to prevent any blur in an image due to a camera shake, a conventional technique which detects a motion vector of an image from a captured image signal, and corrects a blur in the image based on this motion vector has been proposed.
As a method of detecting a motion vector of an image, a correlation method, block matching method, and the like based on correlation calculations are conventionally known. In a block matching method, an image is divided into blocks each having a predetermined size (for example, 8 pixels×8 pixels). Differences from pixels within a predetermined range on a previous field (or frame) are calculated for each block, and a block of the previous field (frame) having a smallest sum of the absolute values of these differences is searched for. Then, a relative deviation between the current field (or frame) and the previous field (or frame) indicates a motion vector of the found block.
Matching calculations have been discussed in detail in Morio Onoe, et. al. “Information Processing Vol. 17, No. 7, p. 634-640 July 1976”.
An example of the conventional motion vector detection method using the block matching method will be described below with reference to the drawings. FIG. 19 shows an example of the arrangement for preventing any blur by the conventional motion vector detection method. An image signal (field image signal) as an object from which a motion vector is to be detected is supplied to an image memory 101 and is temporarily stored in the image memory 101. The image signal is also supplied to a filter 102 which extracts spatial frequency components. The filter 102 extracts spatial frequency components useful for motion vector detection from the image signal. That is, the filter 102 removes low- and high-frequency components of the spatial frequency components of the image signal.
The image signal filtered through the filter 102 is supplied to a binarization circuit 103. The binarization circuit 103 binarizes the image signal with reference to zero level. More specifically, the binarization circuit 103 outputs sign bits of output signals. The binarized image signal is supplied to a correlation calculation circuit 104 and memory 105. The memory 105 is used to delay the image signal by one field period. The image signal one field before read out from the memory 105 is supplied to the correlation calculation circuit 104.
The correlation calculation circuit 104 divides an image region of the image signal into blocks each having a predetermined size and makes correlation calculations between the current and previous fields for respective blocks according to the block matching method. Correlation values for respective blocks calculated by the correlation calculations are supplied to a motion vector detection circuit 106. The motion vector detection circuit 106 detects motion vectors for respective blocks from the supplied correlation values. More specifically, the motion vector detection circuit 106 searches for a block of the previous field having a smallest correlation value to detect that relative deviation as a motion vector.
Motion vectors for respective blocks are supplied to a motion vector decision circuit 107. The motion vector decision circuit 107 decides a motion vector for the entire field image from the motion vectors for respective blocks. More specifically, the motion vector decision circuit 107 decides a median value or average value of the motion vectors for respective blocks as the motion vector of the entire field image.
The motion vector decision circuit 107 supplies the decided entire motion vector to a memory read control circuit 108. The memory read control circuit 108 reads out the field image signal stored in the image memory 101 and outputs the readout field image signal. At this time, the memory read control circuit 108 controls the read position of the image memory 101 so as to cancel motion in an image according to the entire motion vector decided by the motion vector decision circuit 107. In this manner, the image signal in which blur is corrected is output from the image memory 101.
In the aforementioned conventional method, when an image includes a moving object, and an average value of the motion vectors detected for respective blocks is decided as the entire motion vector, the motion of the moving object in the image mixes in the entire motion vector. As a result, the read position of the image memory 101 changes so as to hold the moving object at an original position within the frame under the control of the memory read control circuit 108. Since the position of a region in the frame, which is originally free from any motion, changes, an image in the frame moves as if it were pulled by the moving object.
In order to solve this problem, Japanese Patent Laid-Open No. 04-180370 discloses a technique which sets weighting coefficients for respective block regions, and calculates a motion vector for the entire frame based on the weighting coefficients and vector detection values of the respective block regions. According to Japanese Patent Laid-Open No. 04-180370, small weighting coefficients are set for the center of the frame since a moving object such as a person is more likely to exist there, and large weighting coefficients are set for the surrounding portion of the frame, thus avoiding motion as if an image in the frame were pulled by the moving object.
According to the aforementioned method of Japanese Patent Laid-Open No. 04-180370, when the occupation ratio of a principal object 200 (person) in the frame is relatively small, as shown in, for example, FIG. 20A, a motion vector approximate to a blur in a background region can be calculated by setting large weighting coefficients of the background region in the surrounding portion of the frame. However, when occupation ratio of the object 200 in the frame is relatively large, as shown in FIG. 20B, since both the object 200 and background exist on the region of the surrounding portion of the frame, errors of the motion vector detection values become larger.